home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / C Internet Config / Examples ƒ / Space Aliens / IC Libraries ƒ / IC Headers ƒ / IC Component API Descriptions.h < prev    next >
Encoding:
Text File  |  1995-11-17  |  22.2 KB  |  372 lines  |  [TEXT/SPM ]

  1. air.
  2.     
  3.     Requests the user to create a new configuration, typically using some
  4.     sort of modal dialog. If the user cancels the dialog the configuration
  5.     state will be unaffected.
  6. */
  7.  
  8. pascal ICError ICCGetConfigName(internetConfigurationComponent inst, Boolean longname, Str255 name)
  9. /*
  10.     Requires IC 1.2.
  11.     
  12.     You must specify a configuration before calling this routine.
  13.     Returns a string that describes the current configuration at a user
  14.     level. Set longname to true if you want a long name, up to 255
  15.     characters, or false if you want a short name, typically about 32
  16.     characters.
  17.     The returned string is for user display only. If you rely on the
  18.     exact format of it, you will conflict with any future IC
  19.     implementation that doesn't use explicit preference files.
  20. */
  21.  
  22. pascal ICError ICCGetConfigReference(internetConfigurationComponent inst, ICConfigRefHandle ref)
  23. /*
  24.     Requires IC 1.2.
  25.     
  26.     You must specify a configuration before calling this routine.
  27.     Returns a self-contained reference to the instance's current
  28.     configuration.
  29.     ref must be a valid non-nil handle and it will be resized to fit the
  30.     resulting data.
  31. */
  32.  
  33. pascal ICError ICCSetConfigReference(internetConfigurationComponent inst, ICConfigRefHandle ref, long flags)
  34. /*
  35.     Requires IC 1.2.
  36.     
  37.     It is illegal to call this routine inside a ICBegin/End pair.
  38.     
  39.     Reconfigures the instance using a configuration reference that was
  40.     got using ICGetConfigReference reference. Set the
  41.     icNoUserInteraction_bit in flags if you require that this routine
  42.     not present a modal dialog. Other flag bits are reserved and should
  43.     be set to zero.
  44.     ref must not be nil.
  45. */
  46.  
  47. pascal ICError ICCSpecifyConfigFile(internetConfigurationComponent inst, FSSpec *config)
  48. /*
  49.     It is illegal to call this routine inside a ICBegin/End pair.
  50.     
  51.     For use only by the IC application.
  52.     If you call this routine yourself, you will conflict with any
  53.     future IC implementation that doesn't use explicit preference files.
  54. */
  55.  
  56. /* ***** Getting Information ***** */
  57.  
  58. pascal ICError ICCGetSeed(internetConfigurationComponent inst, long *seed)
  59. /*
  60.     You do not have to specify a configuration before calling this routine.
  61.     You do not have to be inside an ICBegin/End pair to call this routine.
  62.     Returns the current seed for the IC prefs database.
  63.     This seed changes each time a non-volatile preference is changed.
  64.     You can poll this to determine if any cached preferences change.
  65. */
  66.  
  67. pascal ICError ICCGetPerm(internetConfigurationComponent inst, ICPerm *perm)
  68. /*
  69.     You do not have to specify a configuration before calling this routine.
  70.     Returns the access permissions currently associated with this instance.
  71.     While applications normally know what permissions they have,
  72.     this routine is designed for use by override components.
  73. */
  74.  
  75. pascal ICError ICCDefaultFileName(internetConfigurationComponent inst, Str63 name)
  76. /*
  77.     You do not have to specify a configuration before calling this routine.
  78.     You do not have to be inside an ICBegin/End pair to call this routine.
  79.     Returns the default file name for IC preference files.
  80.     Applications should never need to call this routine.
  81.     If you rely on information returned by this routine yourself,
  82.     you may conflict with any future IC implementation that doesn't use
  83.     explicit preference files.
  84.     The component calls this routine to set up the default IC file name.
  85.     This allows this operation to be intercepted by a component that has
  86.     captured us. It currently gets it from the component resource file.
  87.     The glue version is hardwired to "Internet Preferences".
  88. */
  89.  
  90. /* ***** Reading and Writing Preferences ***** */
  91.  
  92. pascal ICError ICCBegin(internetConfigurationComponent inst, ICPerm perm)
  93. /*
  94.     You must specify a configuration before calling this routine.
  95.     It is illegal to call this routine inside a ICBegin/End pair.
  96.     Starting reading or writing multiple preferences.
  97.     A call to this must be balanced by a call to ICEnd.
  98.     Do not call WaitNextEvent between these calls.
  99.     The perm specifies whether you intend to read or read/write.
  100.     Only one writer is allowed per instance.
  101.     Note that this may open resource files that are not closed
  102.     until setting multiple preferences, you should place
  103.     these calls within an ICBegin/ICEnd pair.
  104.     If you call this routine outside of such a pair, it implicitly
  105.     calls ICBegin(inst, icReadWritePerm).
  106.     Sets the preference specified by key from the IC database to the
  107.     value contained in prefh.
  108.     key must not be the empty string.
  109.     If prefh is nil then the preference value is not set.
  110.     If buf is not nil then the preference value is set to the data
  111.     contained in it.
  112.     If attr is ICattr_no_change then the preference attributes are not set.
  113.     Otherwise the preference attributes are set to attr.
  114.     Returns icPermErr if the previous ICBegin was passed icReadOnlyPerm.
  115.     Returns icPermErr if current attr is locked, new attr is locked and prefh <> nil.
  116. */
  117.  
  118. pascal ICError ICCCountPref(internetConfigurationComponent inst, long *count)
  119. /*
  120.     You must specify a configuration before calling this routine.
  121.     You must be inside an ICBegin/End pair to call this routine.
  122.     Counts the total number of preferences.
  123.     If the routine returns an error, count is set to 0.
  124. */
  125.  
  126. pascal ICError ICCGetIndPref(internetConfigurationComponent inst, long n, Str255 key)
  127. /*
  128.     You must specify a configuration before calling this routine.
  129.     You must be inside an ICBegin/End pair to call this routine.
  130.     Returns the key of the Nth preference.
  131.     n must be positive.
  132.     Returns icPrefNotFoundErr if n is greater than the total number of preferences.
  133.     If the routine returns an error, key is undefined.
  134. */
  135.  
  136. pascal ICError ICCDeletePref(internetConfigurationComponent inst, ConstStr255Param key)
  137. /*
  138.     You must specify a configuration before calling this routine.
  139.     You must be inside an ICBegin/End pair to call this routine.
  140.     Deletes the preference specified by key.
  141.     key must not be the empty string.
  142.     Returns icPrefNotFound if the preference specified by key is not present.
  143. */
  144.  
  145. pascal ICError ICCEnd(internetConfigurationComponent inst)
  146. /*
  147.     You must specify a configuration before calling this routine.
  148.     You must be inside an ICBegin/End pair to call this routine.
  149.     Terminates a preference session, as started by ICBegin.
  150.     You must have called ICBegin before calling this routine.
  151. */
  152.  
  153. /* ***** User Interface Stuff ***** */
  154.  
  155. pascal ICError ICCEditPreferences(internetConfigurationComponent inst, ConstStr255Param key)
  156. /*
  157.     Requires IC 1.1.
  158.     
  159.     You must specify a configuration before calling this routine.
  160.     You do not have to be inside an ICBegin/End pair to call this routine.
  161.     Instructs IC to display the user interface associated with editing
  162.     preferences and focusing on the preference specified by key.
  163.     If key is the empty string then no preference should be focused upon.
  164.     You must have specified a configuration before calling this routine.
  165.     You do not need to call ICBegin before calling this routine.
  166.     In the current implementation this launches the IC application
  167.     (or brings it to the front) and displays the window containing
  168.     the preference specified by key.
  169.     It may have a radically different implementation in future
  170.     IC systems.
  171. */
  172.  
  173. /* ***** URL Handling ***** */
  174.  
  175. pascal ICError ICCParseURL(internetConfigurationComponent inst, ConstStr255Param hint, Ptr data, long len,
  176.         long *selStart, long *selEnd, Handle url)
  177. /*
  178.     Requires IC 1.1.
  179.     
  180.     You must specify a configuration before calling this routine.
  181.     You do not have to be inside an ICBegin/End pair to call this routine.
  182.     Parses a URL out of the specified text and returns it in a canonical form
  183.     in a handle.
  184.     hint indicates the default scheme for URLs of the form "name@address".
  185.     If hint is the empty string then URLs of that form are not allowed.
  186.     data points to the start of the text. It must not be nil.
  187.     len indicates the length of the text. It must be non-negative.
  188.     selStart and selEnd should be passed in as the current selection of
  189.     the text. This selection is given in the same manner as TextEdit,
  190.     ie if selStart = selEnd then there is no selection only an insertion
  191.     point. Also selStart ≤ selEnd and 0 ≤ selStart ≤ len and 0 ≤ selEnd ≤ len.
  192.     selStart and selEnd are returned as the bounds of the URL. If the
  193.     routine returns an error then these new boundaries may be
  194.     invalid but they will be close.
  195.     The incoming url handle must not be nil.  The resulting URL is normalised
  196.     and copied into the url handle, which is resized to fit.
  197. */
  198.  
  199. pascal ICError ICCLaunchURL(internetConfigurationComponent inst, ConstStr255Param hint, Ptr data, long len,
  200.         long *selStart, long *selEnd)
  201. /*
  202.     Requires IC 1.1.
  203.     
  204.     You must specify a configuration before calling this routine.
  205.     You do not have to be inside an ICBegin/End pair to call this routine.
  206.     Parses a URL out of the specified text and feeds it off to the
  207.     appropriate helper.
  208.     hint indicates the default scheme for URLs of the form "name@address".
  209.     If hint is the empty string then URLs of that form are not allowed.
  210.     data points to the start of the text. It must not be nil.
  211.     len indicates the length of the text. It must be non-negative.
  212.     selStart and selEnd should be passed in as the current selection of
  213.     the text. This selection is given in the same manner as TextEdit,
  214.     ie if selStart = selEnd then there is no selection only an insertion
  215.     point. Also selStart ≤ selEnd and 0 ≤ selStart ≤ len and 0 ≤ selEnd ≤ len.
  216.     selStart and selEnd are returned as the bounds of the URL. If the
  217.     routine returns an error then these new boundaries may be
  218.     invalid but they will be close.
  219.     The URL is parsed out of the text and passed off to the appropriate
  220.     helper using the GURL AppleEvent.
  221. */
  222.  
  223. /* ***** Mappings Routines *****
  224.  * 
  225.  * Routines for interrogating mappings database.
  226.  * 
  227.  * ----- High Level Routines -----
  228.  */
  229.  
  230. pascal ICError ICCMapFilename(internetConfigurationComponent inst, ConstStr255Param filename, ICMapEntry *entry)
  231. /*
  232.     Requires IC 1.1.
  233.     
  234.     You must specify a configuration before calling this routine.
  235.     If you are getting or setting multiple preferences, you should place
  236.     these calls within an ICBegin/ICEnd pair.
  237.     If you call this routine outside of such a pair, it implicitly
  238.     calls ICBegin(inst, icReadWritePerm).
  239.     Takes the name of an incoming file and returns the most appropriate
  240.     mappings database entry, based on its extension.
  241.     filename must not be the empty string.
  242.     Returns icPrefNotFoundErr if no suitable entry is found.
  243. */
  244.  
  245. pascal ICError ICCMapTypeCreator(internetConfigurationComponent inst, OSType fType, OSType fCreator,
  246.         ConstStr255Param filename, ICMapEntry *entry)
  247. /*
  248.     Requires IC 1.1.
  249.     
  250.     You must specify a configuration before calling this routine.
  251.     You must be inside an ICBegin/End pair to call this routine.
  252.     Takes the type and creator (and optionally the name) of an outgoing
  253.     file and returns the most appropriate mappings database entry.
  254.     The filename may be either the name of the outgoing file or
  255.     the empty string.
  256.     Returns icPrefNotFoundErr if no suitable entry found.
  257. */
  258.  
  259. /* ----- Mid Level Routines ----- */
  260.  
  261. pascal ICError ICCMapEntriesFilename(internetConfigurationComponent inst, Handle entries, ConstStr255Param filename,
  262.         ICMapEntry *entry)
  263. /*
  264.     Requires IC 1.1.
  265.     
  266.     You must specify a configuration before calling this routine.
  267.     You do not have to be inside an ICBegin/End pair to call this routine.
  268.     Takes the name of an incoming file and returns the most appropriate
  269.     mappings database entry, based on its extension.
  270.     entries must be a handle to a valid IC mappings database preference.
  271.     filename must not be the empty string.
  272.     Returns icPrefNotFoundErr if no suitable entry is found.
  273. */
  274.  
  275. pascal ICError ICCMapEntriesTypeCreator(internetConfigurationComponent inst, Handle entries, OSType fType, OSType fCreator,
  276.         ConstStr255Param filename, ICMapEntry *entry)
  277. /*
  278.     Requires IC 1.1.
  279.     
  280.     You must specify a configuration before calling this routine.
  281.     You do not have to be inside an ICBegin/End pair to call this routine.
  282.     Takes the type and creator (and optionally the name) of an outgoing
  283.     file and returns the most appropriate mappings database entry.
  284.     entries must be a handle to a valid IC mappings database preference.
  285.     The filename may be either the name of the outgoing file or
  286.     the empty string.
  287.     Returns icPrefNotFoundErr if no suitable entry found.
  288. */
  289.  
  290. /* ----- Low Level Routines ----- */
  291.  
  292. pascal ICError ICCCountMapEntries(internetConfigurationComponent inst, Handle entries, long *count)
  293. /*
  294.     Requires IC 1.1.
  295.     
  296.     You must specify a configuration before calling this routine.
  297.     You do not have to be inside an ICBegin/End pair to call this routine.
  298.     Counts the number of entries in the mappings database.
  299.     entries must be a handle to a valid IC mappings database preference.
  300.     count is set to the number of entries.
  301. */
  302.  
  303. pascal ICError ICCGetIndMapEntry(internetConfigurationComponent inst, Handle entries, long ndx, long *pos, ICMapEntry *entry)
  304. /*
  305.     Requires IC 1.1.
  306.     
  307.     You must specify a configuration before calling this routine.
  308.     You do not have to be inside an ICBegin/End pair to call this routine.
  309.     Gets the ndx'th entry in the mappings database.
  310.     entries must be a handle to a valid IC mappings database preference.
  311.     ndx must be in the range from 1 to the number of entries in the database.
  312.     The value of pos is ignored on input. pos is set to the position of
  313.     the ndx'th entry in the database and is suitable for passing back
  314.     into ICSetMapEntry.
  315.     Does not return any user data associated with the entry.
  316. */
  317.  
  318. pascal ICError ICCGetMapEntry(internetConfigurationComponent inst, Handle entries, long pos, ICMapEntry *entry)
  319. /*
  320.     Requires IC 1.1.
  321.     
  322.     You must specify a configuration before calling this routine.
  323.     You do not have to be inside an ICBegin/End pair to call this routine.
  324.     Returns the entry located at position pos in the mappings database.
  325.     entries must be a handle to a valid IC mappings database preference.
  326.     pos should be 0 to get the first entry. To get the subsequent entries, add
  327.     entry.total_size to pos and iterate.
  328.     Does not return any user data associated with the entry.
  329. */
  330.  
  331. pascal ICError ICCSetMapEntry(internetConfigurationComponent inst, Handle entries, long pos, ICMapEntry *entry)
  332. /*
  333.     Requires IC 1.1.
  334.     
  335.     You must specify a configuration before calling this routine.
  336.     You do not have to be inside an ICBegin/End pair to call this routine.
  337.     Sets the entry located at position pos in the mappings database.
  338.     entries must be a handle to a valid IC mappings database preference.
  339.     pos should be either a value returned from ICGetIndMapEntry or a value
  340.     calculated using ICGetMapEntry.
  341.     entry is a var parameter purely for stack space reasons. It is not
  342.     modified in any way.
  343.     Any user data associated with the entry is unmodified.
  344. */
  345.  
  346. pascal ICError ICCDeleteMapEntry(internetConfigurationComponent inst, Handle entries, long pos)
  347. /*
  348.     Requires IC 1.1.
  349.     
  350.     You must specify a configuration before calling this routine.
  351.     You do not have to be inside an ICBegin/End pair to call this routine.
  352.     Deletes the mappings database entry at pos.
  353.     entries must be a handle to a valid IC mappings database preference.
  354.     pos should be either a value returned from ICGetIndMapEntry or a value
  355.     calculated using ICGetMapEntry.
  356.     Also deletes any user data associated with the entry.
  357. */
  358.  
  359. pascal ICError ICCAddMapEntry(internetConfigurationComponent inst, Handle entries, ICMapEntry *entry)
  360. /*
  361.     Requires IC 1.1.
  362.     
  363.     You must specify a configuration before calling this routine.
  364.     You do not have to be inside an ICBegin/End pair to call this routine.
  365.     Adds an entry to the mappings database.
  366.     entries must be a handle to a valid IC mappings database preference.
  367.     The entry is added to the end of the entries database.
  368.     No user data is added.
  369. */
  370.  
  371. #endif
  372.